<%@page import="net.jeeshop.core.front.SystemManager" %>
<%@page import="org.apache.commons.lang.StringUtils" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html class="no-js">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <s:if test="e.title==null or e.title==''">
        <title><s:property escape="false" value="e.name"/></title>
    </s:if>
    <s:else>
        <title><s:property escape="false" value="e.title"/></title>
    </s:else>

    <s:if test="e.description==null or e.description==''">
        <meta name="description" content="<s:property escape="false" value="e.name" />"/>
    </s:if>
    <s:else>
        <meta name="description" content="<s:property escape="false" value="e.description" />"/>
    </s:else>

    <s:if test="e.keywords==null or e.keywords==''">
        <meta name="keywords" content="<s:property escape="false" value="e.name" />"/>
    </s:if>
    <s:else>
        <meta name="keywords" content="<s:property escape="false" value="e.keywords" />"/>
    </s:else>

    <link rel="shortcut icon" href="<%=SystemManager.systemSetting.getShortcuticon()%>">
    <%@ include file="/resource/common_css.jsp" %>
    <style type="text/css">
        .topCss {
            height: 28px;
            line-height: 28px;
            background-color: #f8f8f8;
            border-bottom: 1px solid #E6E6E6;
            padding-left: 9px;
            font-size: 14px;
            font-weight: bold;
            position: relative;
            margin-top: 0px;
        }

        .left_product {
            font-size: 12px;
            display: inline-block;
            overflow: hidden;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 150px;
        }

        img.err-product {
        <%
        if(StringUtils.isNotBlank(SystemManager.systemSetting.getDefaultProductImg())){
        %> background: url(<%=SystemManager.systemSetting.getDefaultProductImg()%>) no-repeat 50% 50%;
        <%}%>
        }

        .nowPrice {
            color: #F00;
            font-family: "微软雅黑";
            font-size: 20px;
        }

        .spec li {
            display: inline-block;
            position: relative;
            margin: 0 4px 4px 0;
            line-height: 16px;
            width: 36px;
            text-align: center;
            vertical-align: middle;
            border: 2px solid #ccc;
            cursor: pointer;
        }

        .spec li.specSelectCss {
            border: 2px solid #000;
        }

        .specNotAllowed {
            color: #CDCDCD;
            cursor: not-allowed;
        }

        .lazy {
            display: none;
        }
    </style>
    <script>
        function defaultProductImg() {
            if (1 == 1) {
                return;
            }
            var img = event.srcElement;
            img.src = "<%=SystemManager.systemSetting.getDefaultProductImg() %>";
            img.onerror = null; //控制不要一直跳动
        }
    </script>
</head>

<body>
<div id="wrap">
    <%@ include file="indexMenu.jsp" %>
    <div class="container">
        <!-- 产品详细信息-->
        <div class="row product-detail">
            <!-- 热门商品列表 -->
            <div class="col-xs-3" style="border: 1px solid #c0c0c0; text-align: left;">
                <div class="row">
                    <h4 class="topCss">Bestseller</h4>
                </div>
                <%
                    Object _code = request.getAttribute("childrenCatalogCode");
                    String _codeStr = null;
                    if (_code != null) {
                        _codeStr = _code.toString();
                    }
                    application.setAttribute("hotProducts", SystemManager.getInstance().getProductsByCatalogCode(_codeStr));
                    application.setAttribute("language",session.getAttribute("WW-TRANS-I18N-LOCALE"));
                %>
                <s:iterator value="#application.hotProducts" status="i" var="item">
                    <div class="row">
                        <div class="col-xs-3">

                            <a style="width: 50px;height: 50px;"
                               href="<%=request.getContextPath() %>/product/<s:property escape="false" value="id" />.html"
                               target="_blank" title="<s:property escape="false" value="name" />">
                                <img class="lazy"
                                     style="border: 0px;display: block;margin: auto;width: 50px;height: 50px;"
                                     src="<%=SystemManager.systemSetting.getDefaultProductImg()%>"
                                     data-original="<%=SystemManager.systemSetting.getImageRootPath() %><s:property escape="false" value="picture" />"/>
                            </a>
                        </div>
                        <div class="col-xs-9">
                            <h4>
                                <div class="left_product">
                                    <a title="<s:property escape="false" value="name" />"
                                       href="<%=request.getContextPath() %>/product/<s:property escape="false" value="id" />.html"
                                       target="_blank">
                                        <s:property escape="false" value="name"/>
                                    </a>
                                </div>
                            </h4>
                            <div class="row">
                                <div class="col-xs-6">
                                    <b style="font-weight: bold;color: #EC8A92;">
                                        ￥<s:property escape="false" value="nowPrice"/>
                                    </b>
                                </div>
                                <div class="col-xs-6">
                                    <b style="text-decoration: line-through;font-weight: normal;font-size: 11px;color: #a5a5a5;">
                                        ￥<s:property escape="false" value="price"/>
                                    </b>
                                </div>
                            </div>
                        </div>
                    </div>
                    <br>
                </s:iterator>

                <!-- 特价商品 -->
                <div class="row">
                    <h4 class="topCss">Specials</h4>
                </div>
                <%
                    application.setAttribute("saleProducts", SystemManager.saleProducts);

                %>
                <s:iterator value="#application.saleProducts" status="i" var="item">
                    <div class="row">
                        <div class="col-xs-3">
                            <a href="<%=request.getContextPath() %>/product/<s:property escape="false" value="id" />.html"
                               target="_blank" title="<s:property escape="false" value="name" />">

                                <img class="lazy"
                                     style="border: 0px;display: block;margin: auto;width: 50px;height: 50px;"
                                     src="<%=SystemManager.systemSetting.getDefaultProductImg()%>"
                                     data-original="<%=SystemManager.systemSetting.getImageRootPath() %><s:property escape="false" value="picture" />"/>
                            </a>
                        </div>
                        <div class="col-xs-9">
                            <h4>
                                <div class="left_product">
                                    <a title="<s:property escape="false" value="name" />"
                                       href="<%=request.getContextPath() %>/product/<s:property escape="false" value="id" />.html"
                                       target="_blank">
                                        <s:property escape="false" value="name"/>
                                    </a>
                                </div>
                            </h4>
                            <div class="row">
                                <div class="col-xs-6">
                                    <b style="font-weight: bold;color: #EC8A92;">
                                        ￥<s:property escape="false" value="nowPrice"/>
                                    </b>
                                </div>
                                <div class="col-xs-6">
                                    <b style="text-decoration: line-through;font-weight: normal;font-size: 11px;color: #a5a5a5;">
                                        ￥<s:property escape="false" value="price"/>
                                    </b>
                                </div>
                            </div>
                        </div>
                    </div>
                    <br>
                </s:iterator>


                <%@ include file="history_productList.jsp" %>
            </div>

            <!-- 商品图片列表和购买按钮 -->
            <div class="col-xs-9" style="border: 0px solid red; text-align: left;">
                <!-- 导航 -->
                <div class="row" style="margin-top: 0px;">
                    <div class="col-xs-12">
                        <ol class="breadcrumb" style="margin-bottom: 0px;">
                            <li><a href="<%=SystemManager.systemSetting.getWww()%>">home</a></li>
                            <li><s:property escape="false" value="e.mainCatalogName"/></li>
                            <s:if test="e.childrenCatalogName!=null">
                                <li class="active"><a
                                        href="<%=SystemManager.systemSetting.getWww()%>/catalog/<s:property escape="false" value="e.childrenCatalogCode"/>.html"><s:property
                                        escape="false" value="e.childrenCatalogName"/></a></li>
                            </s:if>
                        </ol>
                    </div>
                </div>

                <!-- 如果商品有赠品，则显示到此处 -->
                <div class="row" style="margin-top: 10px;">
                    <div class="col-xs-12">
                        <s:if test="e.gift!=null">
                            <ul class="list-group">
                                <li class="list-group-item">
                                    商品赠品：<s:property escape="false" value="e.gift.giftName"/>
                                    <button class="btn btn-link btn-xs" onclick="showGiftDetail()">【详情】</button>

                                    <div style="display: none;" id="giftDetailDiv">
                                        <div class="row" style="margin-top: 10px;">
                                            <div class="col-xs-6">
                                                <img class="lazy"
                                                     style="border: 0px;display: block;margin: auto;max-width: 100%;"
                                                     src="<%=SystemManager.systemSetting.getImageRootPath() %><s:property escape="false" value="e.gift.picture" />"/>
                                            </div>
                                            <div class="col-xs-6">
                                                赠品名称：<s:property escape="false" value="e.gift.giftName"/><br>
                                                市场价：<s:property escape="false" value="e.gift.giftPrice"/><br>
                                                赠品数量有限，赠完即止！
                                            </div>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </s:if>
                    </div>
                </div>

                <div class="row" style="margin-top: 10px;">
                    <div class="col-xs-5" id="productMainDiv">
                        <%@ include file="product_center_piclist_slide2.jsp" %>
                        <!--
							<ul id="myGallery">
								<li style="max-width: 408px; height: 200px;"><img src="<s:property escape="false" value="e.maxPicture" />" />
								<s:iterator value="e.imageList" status="i" var="img">
									<li style="max-width: 408px; height: 200px;"><img src="<s:property escape="false" value="img" />" />
								</s:iterator>
							</ul>
							 -->
                    </div>

                    <!-- 产品详细信息 -->
                    <div class="col-xs-7">
                        <div style="line-height: 20px;">
                            <!-- 活动判断，显示HTML -->
                            <s:if test="e.activityID!=null">
                                <s:if test="!e.expire">
                                    <ul class="list-group">
                                        <li class="list-group-item">
                                            <s:if test="e.activityType.equals(\"c\")">
                                                <s:if test="e.discountType.equals(\"d\")">
														<span class="badge pull-right" style="background-color:red;">
															<s:property escape="false"
                                                                        value="e.discountFormat"/>折</span>
                                                    <span class="badge pull-left">折扣价
															<b style="font-weight: bold;">
																￥<s:property escape="false" value="e.finalPrice"/>
															</b>
														</span>
                                                </s:if>
                                                <s:elseif test="e.discountType.equals(\"r\")">
                                                    <%-- 													<span class="badge pull-left" style="background-color:red;"> --%>
                                                    <span class="label label-danger">促销价
															<b style="font-weight: bold;">
																￥<s:property escape="false" value="e.finalPrice"/>
															</b>
														</span>
                                                </s:elseif>
                                                <s:elseif test="e.discountType.equals(\"s\")">
                                                    <span class="label label-success">双倍积分</span>
                                                </s:elseif>
                                            </s:if>
                                            <s:elseif test="e.activityType.equals(\"j\")">
													<span class="badge pull-left" style="background-color:red;">兑换积分:
														<b style="font-weight: bold;">
															<s:property escape="false" value="e.exchangeScore"/>
														</b>
													</span>
                                            </s:elseif>
                                            <s:elseif test="e.activityType.equals(\"t\")">
													<span class="badge pull-left" style="background-color:red;">团购价:
														<b style="font-weight: bold;">
															<s:property escape="false" value="e.tuanPrice"/>
														</b>
													</span>
                                            </s:elseif>


                                            <br>
                                            <!-- 活动结束时间显示 -->
                                            距离活动结束还剩：
                                            <div style="display: inline;" timer="activityEndDateTime"
                                                 activityEndDateTime="<s:property escape="false" value="e.activityEndDateTime" />"></div>
                                            <s:if test="e.maxSellCount!=0">
                                                <br>
                                                <div>最多购买：<s:property escape="false" value="e.maxSellCount"/>件</div>
                                            </s:if>
                                            <div>会员范围：<s:property escape="false" value="e.accountRange"/></div>
                                        </li>
                                    </ul>
                                </s:if>
                                <s:else>
                                    <ul class="list-group">
                                        <li class="list-group-item">
                                            活动已经结束！
                                        </li>
                                    </ul>
                                </s:else>
                            </s:if>
                            <!-- 活动判断，显示HTML END-->

                            <div class="row">
                                <div class="col-xs-12 property-panel">
                                    <div style="font-weight: bold;font-size: 18px;margin-bottom: 8px;"><s:property
                                            escape="false" value="e.name"/></div>
                                    <dl class="clearfix">
                                        <dt><s:text name="product.marketPrice"/></dt>
                                        <dd>
                                            <b style="text-decoration: line-through;font-weight: normal;font-size: 11px;color: #a5a5a5;">
                                                $<s:property escape="false" value="e.price"/>
                                            </b>
                                        </dd>
                                    </dl>
                                    <dl class="clearfix">
                                        <dt><s:text name="product.presentPrice"/></dt>
                                        <dd>
                                            <s:if test="e.activityID!=null and !e.expire && !e.discountType.equals(\"s\")">
                                            <b class="nowPrice"
                                               style="text-decoration: line-through;font-weight: bold;">
                                                </s:if>
                                                <s:else>
                                                <b class="nowPrice" style="font-weight: bold;">
                                                    </s:else>
                                                    $<span id="nowPrice"><s:property escape="false"
                                                                                     value="e.nowPrice"/></span>
                                                </b>
                                        </dd>
                                    </dl>
                                    <s:if test="e.score>0">
                                        <dl class="clearfix">
                                            <dt><s:text name="product.gift"/></dt>
                                            <s:property value="#application.language"/>
                                            <dd><s:property escape="false" value="e.score"/>个积分点</dd>
                                        </dl>
                                    </s:if>
                                    <dl class="clearfix">
                                        <dt><s:text name="product.sales"/></dt>
                                        <dd><s:property escape="false" value="e.sellcount"/> <s:text
                                                name="product.sold"/></dd>
                                    </dl>
                                    <%-- 								宝贝详情：<s:if test="e.isnew.equals(\"y\")"><font style="color: red;">新品</font>|</s:if> --%>
                                    <%-- 								<s:if test="e.sale.equals(\"y\")"><font style="color: red;">特价</font>|</s:if> --%>
                                    <%-- 								<s:property escape="false" value="e.hit"/>人浏览<br> --%>
                                    <s:if test="e.specJsonString!=null">
                                        <!-- 商品规格 -->
                                        <s:hidden name="e.specJsonString" id="specJsonString"/>
                                        <%-- 									<span class="badge" disabled="disabled">42</span> --%>
                                        <div class="spec" id="specDiv">
                                            <dl class="clearfix">
                                                <dt><s:text name="product.size"/></dt>
                                                <dd>
                                                    <ul class="list-unstyled clearfix" id="specSize">
                                                        <s:iterator value="e.specSize" var="item" status="stat">
                                                            <li><s:property value="item"/></li>
                                                        </s:iterator>
                                                    </ul>
                                                </dd>
                                            </dl>
                                            <a href="kavascript:;" data-toggle="modal" data-target="#guideModal">Fit &
                                                Sizing Guide</a>
                                            <dl class="clearfix">
                                                <dt>Color:</dt>
                                                <dd>
                                                    <ul class="list-unstyled clearfix" id="specColor">
                                                        <s:iterator value="e.specColor" var="item" status="stat">
                                                            <li><s:property value="item"/></li>
                                                        </s:iterator>
                                                    </ul>
                                                </dd>
                                            </dl>
                                        </div>
                                    </s:if>
                                </div>
                            </div>

                            <s:form action="/product/buyNow.html" namespace="/" method="post" theme="simple">
                                <div class="row property-panel" style="margin-bottom: 10px;">
                                    <div class="col-xs-12">
                                        <dl class="clearfix">
                                            <dt><s:text name="product.quantity"/></dt>
                                            <dd>
                                                <span onclick="subFunc()" style="cursor: pointer;"><img
                                                        src="<%=request.getContextPath() %>/resource/images/minimize.png"
                                                        style="vertical-align: middle;"/></span>
                                                <input value="1" size="4" maxlength="4" name="inputBuyNum"
                                                       id="inputBuyNum" style="text-align: center;"/>
                                                <!-- <a id="addProductToCartErrorTips" href="#" data-toggle="tooltip" data-placement="bottom" data-original-title="购买的商品超出库存数！"></a> -->
                                                <span onclick="addFunc(this,false)" style="cursor: pointer;"><img
                                                        src="<%=request.getContextPath() %>/resource/images/maximize.png"
                                                        style="vertical-align: middle;"/></span>


                                                (<s:text name="product.stock"/><span id="stock_span_id"><s:property
                                                    escape="false"
                                                                                            value="e.stock"/></span>
                                                <s:property escape="false" value="e.unit"/>)<br>

                                                <s:hidden name="e.id"/>
                                                <input type="hidden" name="addCart" value="1"/>
                                            </dd>
                                        </dl>
                                    </div>
                                </div>

                                <!-- 超出库存提示语-->
                                <div id="exceedDivError" class="alert alert-danger fade in"
                                     style="display: none;margin-bottom: 0px;">
                                    <!-- 										<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> -->
                                    <h5 id="exceedSpanError"></h5>
                                </div>

                                <div class="row">
                                    <div class="col-xs-12 action-btn-group">
                                        <s:if test="e.status==2 and e.stock>0">
                                            <a name="stockErrorTips"
                                               productid="<s:property escape="false" value="id" />" href="#"
                                               data-toggle="tooltip" title="" data-placement="top"></a>
                                            <button type="button" data-toggle="show" data-placement="top"
                                                    id="addToCartBtn" onclick="addToCart()" value="加入购物车"
                                                    disabled="disabled" class="btn btn-primary btn-sm">
                                                <span class="glyphicon glyphicon-shopping-cart"></span>ADD TO CART
                                            </button>
                                            <%-- 												<s:submit value="加入购物车" cssClass="btn btn-warning" /> --%>
                                        </s:if>
                                        <s:else>
                                            <button type="button" id="addToCartBtn" onclick="addToCart()" value="加入购物车"
                                                    class="btn btn-primary btn-sm" disabled="disabled">
                                                <span class="glyphicon glyphicon-shopping-cart"></span>ADD TO CART
                                            </button>
                                        </s:else>

                                        <button id="addToFavoriteBtn" type="button" onclick="addToFavorite()"
                                                class="btn btn-default btn-sm" disabled="disabled"
                                                data-container="body" data-toggle="popover" data-placement="top"
                                                data-content="">
                                            <span class="glyphicon glyphicon-heart"></span>SAVE TO MY FAVORITES
                                        </button>

                                        <button type="button" id="makeAppointment" onclick="makeAppointment()"
                                                value="预约" class="btn btn-primary btn-sm">
                                            MAKE AN APPOINTMENT
                                        </button>
                                    </div>
                                </div>
                            </s:form>
                            <br>
                            <%application.setAttribute("qqHelpHtml", ss2.getQqHelpHtml()); %>
                            <s:property escape="false" value="#application.qqHelpHtml"/>
                            <hr style="margin-top: 5px;margin-bottom: 5px;">


                            <s:if test="e.stock <= 0">
                                <strong><font style="font-size: 14px;"
                                              class="text-danger">抱歉，该商品已售卖完了！</font></strong><br>
                            </s:if>
                            <s:elseif test="e.status==3">
                                <strong><font style="font-size: 14px;"
                                              class="text-danger">抱歉，该商品已下架！</font></strong><br>
                            </s:elseif>
                            <s:if test="#session.user_info!=null and e.showEmailNotifyProductInput">
                                <div class="row" style="margin-top: 10px;" id="emailNotifyProduct_input">
                                    <div class="col-lg-12">
                                        <div class="input-group">
                                            <input type="text" class="form-control" placeholder="到货通知的邮箱地址"
                                                   id="receiveEmail" maxlength="45" size="45">
                                            <span class="input-group-btn">
									        <button class="btn btn-success" type="button"
                                                    onclick="emailNotifyProduct(this)"><span
                                                    class="glyphicon glyphicon-ok"></span>&nbsp;到货通知</button>
									      </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row" style="margin-top: 10px;">
                                    <div class="col-lg-12 text-success" id="emailNotifyProductDiv"></div>
                                </div>
                            </s:if>

                        </div>
                    </div>
                </div>

                <br>

                <div class="row">
                    <div class="col-xs-12">
                        <%@ include file="product_tab_slide.jsp" %>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel"><b>提示信息:</b></h4>
            </div>
            <div class="modal-body" style="color: #7ABD54;font:normal 24px">
                <h3><span class="glyphicon glyphicon-ok"></span>&nbsp;商品已成功加入购物车！</h3>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" onclick="javascript:$('#myModal').modal('hide');">继续购物
                </button>
                <button class="btn btn-primary" data-dismiss="modal" value="去购物车结算" onclick="toCart();">
                    <span class="glyphicon glyphicon-usd"></span>去购物车结算
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<div class="modal fade" id="guideModal" tabindex="-1" role="dialog" aria-labelledby="guideModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" style="border-bottom-width: 0;">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            </div>
            <div class="modal-body">
                <ul class="nav nav-tabs">
                    <li role="presentation" class="active"><a href="#size" data-toggle="tab">size chart</a></li>
                    <li role="presentation"><a href="#measure" data-toggle="tab">how to measure</a></li>
                    <li role="presentation"><a href="#shipping" data-toggle="tab">shipping & returns</a></li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="size">
                        <h4>SIZE CHART</h4>All measurements shown in inches. 1 inch = 2.54 centimeters<br><br>
                        <p>See <b>How to Measure</b> and <b>Fit Guide</b> for tips.</p>
                        <table align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#cccccc">
                            <tbody>
                            <tr>
                                <td align="left" bgcolor="#ffffff">Size</td>
                                <td align="center" width="30" bgcolor="#eeeeee">0</td>
                                <td align="center" width="30" bgcolor="#eeeeee">2</td>
                                <td align="center" width="30" bgcolor="#eeeeee">4</td>
                                <td align="center" width="30" bgcolor="#eeeeee">6</td>
                                <td align="center" width="30" bgcolor="#eeeeee">8</td>
                                <td align="center" width="30" bgcolor="#eeeeee">10</td>
                                <td align="center" width="30" bgcolor="#eeeeee">12</td>
                                <td align="center" width="30" bgcolor="#eeeeee">14</td>
                                <td align="center" width="30" bgcolor="#eeeeee">16</td>
                                <td align="center" width="30" bgcolor="#eeeeee">18</td>
                                <td align="center" width="30" bgcolor="#eeeeee">20</td>
                                <td align="center" width="30" bgcolor="#eeeeee">22</td>
                                <td align="center" width="30" bgcolor="#eeeeee">24</td>
                                <td align="center" width="30" bgcolor="#eeeeee">26</td>
                            </tr>
                            <tr>
                                <td align="left" bgcolor="#ffffff">Bust</td>
                                <td align="center" bgcolor="#ffffff">32</td>
                                <td align="center" bgcolor="#ffffff">33</td>
                                <td align="center" bgcolor="#ffffff">34</td>
                                <td align="center" bgcolor="#ffffff">35</td>
                                <td align="center" bgcolor="#ffffff">36</td>
                                <td align="center" bgcolor="#ffffff">37 ½</td>
                                <td align="center" bgcolor="#ffffff">39</td>
                                <td align="center" bgcolor="#ffffff">41</td>
                                <td align="center" bgcolor="#ffffff">43 ¼</td>
                                <td align="center" bgcolor="#ffffff">45 ½</td>
                                <td align="center" bgcolor="#ffffff">47 ¾</td>
                                <td align="center" bgcolor="#ffffff">50</td>
                                <td align="center" bgcolor="#ffffff">53</td>
                                <td align="center" bgcolor="#ffffff">56</td>
                            </tr>
                            <tr>
                                <td align="left" bgcolor="#ffffff">Waist</td>
                                <td align="center" bgcolor="#ffffff">25 ½</td>
                                <td align="center" bgcolor="#ffffff">26 ½</td>
                                <td align="center" bgcolor="#ffffff">27 ½</td>
                                <td align="center" bgcolor="#ffffff">28 ½</td>
                                <td align="center" bgcolor="#ffffff">29 ½</td>
                                <td align="center" bgcolor="#ffffff">31</td>
                                <td align="center" bgcolor="#ffffff">32 ½</td>
                                <td align="center" bgcolor="#ffffff">34 ¾</td>
                                <td align="center" bgcolor="#ffffff">37 ¼</td>
                                <td align="center" bgcolor="#ffffff">39 ¾</td>
                                <td align="center" bgcolor="#ffffff">42 ¼</td>
                                <td align="center" bgcolor="#ffffff">44 ¾</td>
                                <td align="center" bgcolor="#ffffff">48</td>
                                <td align="center" bgcolor="#ffffff">51 ¼</td>
                            </tr>
                            <tr>
                                <td align="left" bgcolor="#ffffff">Low Hip</td>
                                <td align="center" bgcolor="#ffffff">35 ½</td>
                                <td align="center" bgcolor="#ffffff">36 ½</td>
                                <td align="center" bgcolor="#ffffff">37 ½</td>
                                <td align="center" bgcolor="#ffffff">38 ½</td>
                                <td align="center" bgcolor="#ffffff">39 ½</td>
                                <td align="center" bgcolor="#ffffff">41</td>
                                <td align="center" bgcolor="#ffffff">42 ½</td>
                                <td align="center" bgcolor="#ffffff">44 ½</td>
                                <td align="center" bgcolor="#ffffff">46 ¾</td>
                                <td align="center" bgcolor="#ffffff">49</td>
                                <td align="center" bgcolor="#ffffff">51 ¼</td>
                                <td align="center" bgcolor="#ffffff">53 ½</td>
                                <td align="center" bgcolor="#ffffff">56 ½</td>
                                <td align="center" bgcolor="#ffffff">59 ½</td>
                            </tr>
                            <tr>
                                <td align="left" bgcolor="#ffffff">Length (hollow to hem)</td>
                                <td align="center" bgcolor="#ffffff">61</td>
                                <td align="center" bgcolor="#ffffff">61</td>
                                <td align="center" bgcolor="#ffffff">61</td>
                                <td align="center" bgcolor="#ffffff">61</td>
                                <td align="center" bgcolor="#ffffff">61</td>
                                <td align="center" bgcolor="#ffffff">61</td>
                                <td align="center" bgcolor="#ffffff">61</td>
                                <td align="center" bgcolor="#ffffff">61</td>
                                <td align="center" bgcolor="#ffffff">63</td>
                                <td align="center" bgcolor="#ffffff">63</td>
                                <td align="center" bgcolor="#ffffff">63</td>
                                <td align="center" bgcolor="#ffffff">63</td>
                                <td align="center" bgcolor="#ffffff">63</td>
                                <td align="center" bgcolor="#ffffff">63</td>
                            </tr>
                            </tbody>
                        </table>
                        <p>* Notes about length: Length measurements are not from the dress neckline to hem, but rather
                            from the center collarbone (Hollow) to the hem of the dress. Please see <b>How to
                                Measure</b> for an illustration and details.</p>
                    </div>
                    <div class="tab-pane" id="measure">
                        <div class="intro"><h4>HOW TO MEASURE</h4>
                            <p>Measure with undergarments similar to those you will wear with your dress; do not measure
                                over other clothing. Make sure the measuring tape is parallel to the floor and pulled
                                evenly across the body with no slack. You may want to consider getting professionally
                                measured. Consult the <b>Size Charts</b> and <b>Fit Guide</b> to determine which size
                                you should purchase.</p></div>
                        <div class="hem"><h5>Length from Hollow to Hem</h5>
                            <p>Measure from the center of the collarbone (Hollow) to the dress hem. Note: The length is
                                <u>not</u> measured starting from the garment neckline.</p></div>
                        <div class="bust"><h5>Bust</h5>
                            <p>Measure across the back and fullest part of the bust (not under the bust).</p></div>
                        <div class="waist"><h5>Waist</h5>
                            <p>Bend to one side to find the crease or natural waist. Measure across the narrowest
                                part.</p></div>
                        <div class="hip"><h5>Hip</h5>
                            <p>Standing with feet together, measure at the fullest part of the hip.</p></div>
                        <img src="http://1.www.davidsbridal.com/u/Q/_t_0R22kI.webp" border="0" width="549" height="950"
                             alt="">
                    </div>
                    <div class="tab-pane" id="shipping">
                        <h4>ONLINE MERCHANDISE SHIPPING</h4>For online merchandise shipping and returns internationally,
                        please see <a href="/Content_HelpFAQ_helpintlordersfaq" target="_blank">Shipping and Return
                        information</a> in the FAQs section.<br><br><h5>Estimated Shipping Dates</h5>
                        <p>Shipping availability and processing time for items purchased on davidsbridal.com differ
                            depending on the product. Please see the specific item's detail page, where we try our best
                            to accurately estimate when it will be available to ship from our facilities. Dates are
                            quoted as an estimated range that may vary based on several factors, including order
                            processing, quantity of items ordered, and additional time for personalized items. The
                            estimated delivery date is determined by a combination of processing time and shipping
                            method chosen (see below for details).</p><h5>Shipping Charges</h5>
                        <p>Shipping fees are very simple at DavidsBridal.com. The shipping fee for each item is shown on
                            the product page along with the product price.</p>
                        <p>You will see your total shipping fee calculate in your shopping cart as you add items.</p>
                        <p>If you order a dress as well as other items (combination order), the flat shipping &amp;
                            handling fee per dress will be added to the shipping fee for other items, based on the
                            following scale. To determine shipping fees for combination orders, subtract the cost of the
                            dress from your order subtotal, then add the per dress flat fee. This will be calculated for
                            you at checkout.</p><h5>Shipping Methods &amp; Estimated Delivery Dates</h5>
                        <p>Please note that orders with multiple items may ship at different times in separate boxes.
                            You will not incur additional shipping charges and will be billed as indicated during your
                            checkout process.</p><h5>WHEN WILL MY ORDER ARRIVE? Shipping Methods &amp; Estimated
                        Delivery Dates:</h5>
                        <p>In order to ensure that your items arrive in time for your event, please use the following
                            delivery calculation chart to determine the estimated date you'll receive your order:</p>
                        <p>(Availability/Processing Time) + (Shipping Method Chosen*) = Estimated Delivery Date</p><img
                            data-feo-orig-src="/wcsstore/images/wwcm/fitAndSizeGuide/shipping_dresses.gif"
                            src="http://1.www.davidsbridal.com/f/1/iTbp5Y-fU.webp" border="0" width="524" height="78"
                            alt="" class="ship_method">
                        <script blzsys="1" type="text/javascript">aFeoOverrideAttrRead('img', 'src')</script>
                        <p><strong>Please note:</strong> Orders with multiple items may ship at different times in
                            separate boxes as different products may have varying processing times.</p>
                        <p><em>*Shipping Methods offered include Standard Shipping (estimated 3-5 business days,
                            depending on delivery address), 2 Business Day Shipping, or Next Business Day Shipping.
                            Invitation samples will be shipped via U.S. Mail. We do not offer expedited weekend
                            delivery.</em></p><h5>Shipping Area</h5>
                        <p>Davidsbridal.com ships to the United States only (including Alaska and Hawaii, but excluding
                            U.S. territories). At this time we cannot ship internationally nor do we ship to post office
                            boxes. Please note that if you live outside the U.S. and have someone else purchase items
                            for you, this person is responsible for mailing the merchandise to you and handling any
                            customs issues.</p>
                        <p>You can shop at davidsbridal.com with confidence; review our Return Policy for online
                            orders.</p>
                        <hr size="1">
                        <h5>ONLINE MERCHANDISE RETURN POLICY</h5>
                        <p>Online merchandise cannot be returned to our stores, we accept online merchandise returns via
                            mail only. Items purchased in David's Bridal stores may not be returned or exchanged,
                            neither in stores nor via mail.</p>
                        <p>We want you to be completely satisfied with your online purchase. Should you need to return
                            an item, please review the complete details of our return policy below to determine if any
                            special conditions apply.</p><h5>Items that cannot be returned:</h5>
                        <ul>
                            <li>Personalized and dyed items are final sale, no returns, no exchanges.</li>
                            <li>Outlet items are final sale, no returns, no exchanges. See our Outlet FAQ.</li>
                            <li>Perishables, earrings, and personal care items are final sale, no returns, no
                                exchanges.
                            </li>
                        </ul>
                        <p>For all other products purchased online, please obtain a Return Merchandise Authorization
                            (RMA) Number within 14 days of the date we shipped your order (see below for how to obtain
                            an RMA Number). Once the RMA is emailed, you will have 14 days to ship back your order. If
                            you would like to replace the item you have returned, please place a new order. While most
                            non-personalized items are returnable, they are subject to the following guidelines:</p><h5>
                        Defective, Damaged or Mis-shipped Items</h5>
                        <p>You will receive a refund for the purchase price plus shipping and handling fees for
                            defective, damaged or mis-shipped items (item shipped was not item ordered). For all other
                            items, shipping and handling fees will not be refunded. (Note: Refunds for the return
                            shipping fee are calculated using the lowest cost shipping method. Items returned via
                            expedited shipping methods will only be refunded an amount equal to the lowest cost shipping
                            method).</p><h5>Conditions for Return and Credit</h5>
                        <p>Returned merchandise must be in new condition. If you are returning a product listed below,
                            please check to make sure your return meets the conditions described.</p>
                        <ul>
                            <li>Dresses - Must be in original condition - unworn, unwashed, unaltered, undamaged, clean
                                and free of lint and hair - and must have the tags intact and still attached. If the
                                product is defective, please provide a detailed explanation in the return package.
                            </li>
                            <li>Books - Must be in their original condition.</li>
                        </ul>
                        <h5>Obtaining an RMA Number</h5>
                        <p>To request a Return Merchandise Authorization Number (RMA#) for an item, please log into <em>My
                            Account</em>. Choose the appropriate order number to process a return request for the item,
                            within 14 days of order shipment. </p>
                        <p>Returns will not be accepted without an RMA #. RMA Numbers will expire after 14 days, and the
                            item will not be accepted if it is returned after that time. Your RMA confirmation will
                            include the address where you should ship your return. If you are returning a dress, your
                            RMA confirmation will include an address label (not prepaid) that you can use to return your
                            merchandise to the proper address. Please include the RMA# on the outside of the shipping
                            package.</p>
                        <p>Returning an item(s) may change or void coupon discounts or refunds currently appearing on an
                            order.</p>
                        <p>For your protection, please send your return prepaid via a shipping service that can be
                            tracked, such as UPS. Please be sure to keep your receipt. We cannot guarantee refunds for
                            returns sent via a non-trackable method.</p>
                        <p>Credits are processed upon confirmation of the return. If you return an item in unacceptable
                            condition we will not be able to process a refund and will therefore ship the merchandise
                            back to you. Please allow up to two billing cycles for the return credit to appear on your
                            credit card statement. In the event that a credit cannot be issued to your credit card, an
                            online store credit will be issued.</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<input type="hidden" value="<s:property escape="false" value="e.name"/>" id="productName">
<input type="hidden" value="<s:property escape="false" value="e.id"/>" id="productID">
<input type="hidden" value="<s:property escape="false" value="e.nowPrice"/>" id="nowPriceHidden">
<input type="hidden" value="<s:property escape="false" value="e.stock"/>" id="stockHidden">
<input type="hidden" id="specIdHidden">
<%@ include file="foot.jsp" %>

<script src="<%=request.getContextPath() %>/resource/js/product.js"></script>
<script src="<%=request.getContextPath() %>/resource/js/front.js"></script>
<script src="<%=request.getContextPath() %>/resource/js/superSlide/jquery.SuperSlide.js"></script>
<script src="<%=request.getContextPath() %>/resource/js/jquery.imagezoom/js/jquery.imagezoom.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $(".jqzoom").imagezoom();

        $("#thumblist li a").click(function () {
            $(this).parents("li").addClass("tb-selected").siblings().removeClass("tb-selected");
            $(".jqzoom").attr('src', $(this).find("img").attr("mid"));
            $(".jqzoom").attr('rel', $(this).find("img").attr("big"));
        });
    });
</script>
<script>
    $(function () {
        $("#addToCartBtn").removeAttr("disabled");
        $("#addToFavoriteBtn").removeAttr("disabled");

        jQuery(".slideTxtBox").slide();
        var ww = $("#productMainDiv").width();
        console.log("aww=" + ww);
        $("#mainBox00").css("width", ww + "px");
        $("#mainBox00").find("img[name=box_img]").css("max-width", ww + "px");

        var specJsonStringVal = $("#specJsonString").val();

        //如果规格存在
        if (specJsonStringVal && specJsonStringVal.length > 0) {
            console.log("specJsonStringVal = " + specJsonStringVal);
            var specJsonStringObject = eval('(' + specJsonStringVal + ')');

            for (var i = 0; i < specJsonStringObject.length; i++) {
                console.log("specJsonStringObject = " + specJsonStringObject[i].specColor);
            }

            //规格被点击，则标记选中和不选中
            $("#specDiv li").click(function () {
                console.log("规格被点击。" + $(this).hasClass("specSelectCss"));
                if ($(this).hasClass("specNotAllowed")) {
                    console.log("由于规格被禁用了，直接返回。");
                    return;
                }

                $(this).parent().find("li").not(this).each(function () {
                    $(this).removeClass("specSelectCss");
                    $(this).attr("disabled", "disabled");
                });
                if ($(this).is(".specSelectCss")) {
                    console.log("removeClass specSelectCss");
                    $(this).removeClass("specSelectCss");

                    //如果当前点击的是尺寸，则释放所有的颜色的禁用状态；如果点击的是颜色，则释放所有的尺寸禁用状态
                    if ($(this).parent().attr("id") == "specSize") {
                        console.log("当前点击的是尺寸。");
                        //释放所有颜色的鼠标禁用状态
                        $("#specColor li").each(function () {
                            $(this).removeClass("specNotAllowed");
                        });
                    } else if ($(this).parent().attr("id") == "specColor") {
                        console.log("当前点击的是颜色。");
                        //释放所有颜色的鼠标禁用状态
                        $("#specSize li").each(function () {
                            $(this).removeClass("specNotAllowed");
                        });
                    } else {
                        console.log("当前点击的东东不明确。");
                    }
                } else {
                    console.log("addClass specSelectCss");
                    $(this).addClass("specSelectCss");
                }

                //$("#specSize")

                var parentID = $(this).parent().attr("id");
                console.log("parentID = " + parentID);

                if ($("#specSize li").hasClass("specSelectCss") && $("#specColor li").hasClass("specSelectCss")) {
                    console.log("都选中了。");

                    console.log("选中的文本：" + $("#specSize .specSelectCss").html());
                    //找出对应的规格
                    for (var i = 0; i < specJsonStringObject.length; i++) {
                        var specItem = specJsonStringObject[i];
                        if (specItem.specSize == $("#specSize .specSelectCss").html()
                                && specItem.specColor == $("#specColor .specSelectCss").html()) {
                            console.log("找到了规格对象。");
                            //改变商品的价格和库存数
                            $("#nowPrice").text(specItem.specPrice);
                            $("#stock_span_id").text(specItem.specStock);
                            $("#specIdHidden").val(specItem.id);
                            console.log("选中的规格ID=" + $("#specIdHidden").val());
                            break;
                        }
                    }
                    //specNotAllowed
                } else if ($("#specSize li").hasClass("specSelectCss")) {
                    resetProductInfo();
                    //尺寸被选中了一个，则将于该尺寸不匹配的颜色禁用掉。
                    console.log("尺寸被选中了一个，则将于该尺寸不匹配的颜色禁用掉。");
                    //找出对应的规格
                    var colorArr = [];//与选中的规格相匹配的颜色集合
                    for (var i = 0; i < specJsonStringObject.length; i++) {
                        var specItem = specJsonStringObject[i];
                        if (specItem.specSize == $("#specSize .specSelectCss").html()) {
                            colorArr.push(specItem.specColor);
                        }
                    }

                    //释放所有颜色的鼠标禁用状态
                    $("#specColor li").each(function () {
                        $(this).removeClass("specNotAllowed");
                    });

                    //找出于选择的尺寸不匹配的颜色，将其禁用掉。
                    for (var i = 0; i < specJsonStringObject.length; i++) {
                        var specItem = specJsonStringObject[i];
                        var hanFind = false;
                        for (var j = 0; j < colorArr.length; j++) {
                            if (specItem.specColor == colorArr[j]) {
                                hanFind = true;
                                break;
                            }
                        }

                        if (!hanFind) {
                            console.log("禁掉的颜色有：" + specItem.specColor);

                            $("#specColor li").each(function () {
                                console.log("text=" + $(this).text());
                                if ($(this).text() == specItem.specColor) {
                                    console.log("找到了。");
                                    $(this).addClass("specNotAllowed");
                                    return false;
                                }
                            });
                        }
                    }

                } else if ($("#specColor li").hasClass("specSelectCss")) {
                    resetProductInfo();
                    //颜色被选中了一个，则将于该颜色不匹配的尺寸禁用掉。
                    console.log("颜色被选中了一个，则将于该颜色不匹配的尺寸禁用掉。");

                    //找出对应的规格
                    var sizeArr = [];//与选中的规格相匹配的颜色集合
                    for (var i = 0; i < specJsonStringObject.length; i++) {
                        var specItem = specJsonStringObject[i];
                        if (specItem.specColor == $("#specColor .specSelectCss").html()) {
                            sizeArr.push(specItem.specSize);
                        }
                    }

                    //释放所有颜色的鼠标禁用状态
                    $("#specSize li").each(function () {
                        $(this).removeClass("specNotAllowed");
                    });

                    //找出于选择的尺寸不匹配的颜色，将其禁用掉。
                    for (var i = 0; i < specJsonStringObject.length; i++) {
                        var specItem = specJsonStringObject[i];
                        var hanFind = false;
                        for (var j = 0; j < sizeArr.length; j++) {
                            if (specItem.specSize == sizeArr[j]) {
                                hanFind = true;
                                break;
                            }
                        }

                        if (!hanFind) {
                            console.log("禁掉的尺寸有：" + specItem.specSize);

                            $("#specSize li").each(function () {
                                console.log("text=" + $(this).text());
                                if ($(this).text() == specItem.specSize) {
                                    console.log("找到了。");
                                    $(this).addClass("specNotAllowed");
                                    return false;
                                }
                            });
                        }
                    }

                } else {
                    console.log("都没选中。");
                    resetProductInfo();
                }

            });
        }

    });

    //重置商品信息
    function resetProductInfo() {
        console.log("resetProductInfo..." + $("#nowPriceHidden").val());
        //设置值为商品原价格
        $("#nowPrice").text($("#nowPriceHidden").val());
        $("#stock_span_id").text($("#stockHidden").val());
        $("#specIdHidden").val("");
    }

    //去购物车结算
    function toCart() {
        window.location.href = "<%=SystemManager.systemSetting.getWww()%>/cart/cart.html";
    }
    var options = {
        animation: true,
        trigger: 'hover', //触发tooltip的事件
        show: 500, hide: 100
    };
    //添加商品收藏
    function addToFavorite() {
        var _url = "addToFavorite.html?productID=" + $("#productID").val() + "&radom=" + Math.random();
        console.log("_url=" + _url);
        $.ajax({
            type: 'POST',
            url: _url,
            data: {},
            success: function (data) {
                console.log("addToFavorite.data=" + data);
                var _result = "商品已成功添加到收藏夹！";
                if (data == "0") {
                    _result = "商品已成功添加到收藏夹！";
                } else if (data == '1') {
                    _result = "已添加，无需重复添加！";
                } else if (data == '-1') {//提示用户要先登陆
                    _result = "使用此功能需要先登陆！";
                }

                $('#addToFavoriteBtn').attr("data-content", _result).popover("toggle");
            },
            dataType: "text",
            error: function (er) {
                console.log("addToFavorite.er=" + er);
            }
        });
    }
    //到货通知
    function emailNotifyProduct(obj) {
        var _receiveEmail = $("#receiveEmail").val();
        if ($.trim(_receiveEmail).length == 0) {
            $("#receiveEmail").focus();
            return;
        }

        var _url = "insertEmailNotifyProductService.html?receiveEmail=" + _receiveEmail + "&productID=" + $("#productID").val() + "&productName=" + $("#productName").val();
        console.log("_url=" + _url);
        $(obj).attr({"disabled": "disabled"});
        $.ajax({
            type: 'POST',
            url: _url,
            data: {},
            success: function (data) {
                console.log("emailNotifyProduct.data=" + data);
                var _result = "到货通知添加成功！";
                if (data == "0") {
                } else if (data == '-1') {//提示用户要先登陆
                    _result = "使用此功能需要先登陆！";
                }
                $("#emailNotifyProduct_input").hide();
                $("#emailNotifyProductDiv").html(_result);
                console.log(_result);
            },
            dataType: "text",
            error: function (er) {
                console.log("emailNotifyProduct.er=" + er);
                $("#emailNotifyProductDiv").html("添加到货通知失败，请联系站点管理员！");
            }
        });
    }

    //显示礼品详情
    function showGiftDetail() {
        if ($("#giftDetailDiv").is(':hidden')) {
            $("#giftDetailDiv").slideDown(1000);
        } else {
            $("#giftDetailDiv").slideUp(1000);
        }
    }

</script>

<!-- baidu fenxiang -->
<script>window._bd_share_config = {
    "common": {
        "bdSnsKey": {},
        "bdText": "",
        "bdMini": "2",
        "bdMiniList": false,
        "bdPic": "",
        "bdStyle": "0",
        "bdSize": "16"
    }, "slide": {"type": "slide", "bdImg": "0", "bdPos": "right", "bdTop": "100"}
};
with (document)0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];</script>
<!-- Baidu Button END -->

</body>
</html>
